home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-07 | 1.7 KB | 56 lines | [TEXT/MPCC] |
- // ----------------------------------------------------------------------------------
- // Utility.c
- // ----------------------------------------------------------------------------------
- // Various utility functions.
- //
- // This demo is copywrite 1994 by LexTek Internation. Feel free to use it for
- // whatever purpose you wish. The SpellWright Library may not be copied or
- // distributed, except when linked to your application that adds significant features
- // to the code. ie. you can't take the library, make a new library and sell it. You
- // can, however, use it without royalties in applications or other such projects.
- //
- // LexTek International
- // 2255 N. University Parkway, Suit 15
- // Provo, UT 84604
- // (801) 375.8332 Phone
- // (801) 375.7654 Fax
- //
- // ----------------------------------------------------------------------------------
- // History:
- // 9/26/94 Clark Goble Original
- //
-
- // ----------------------------------------------------------------------------------
- // pstrcat
- // ----------------------------------------------------------------------------------
- // Concatinates two pascal strings.
-
- void pstrcat(register char *s1, register char *s2)
- {
- register char *p;
- register short len, i;
-
- if (*s1+*s2<=255)
- {
- p = *s1 + s1 + 1;
- *s1 += (len = *s2++);
- }
- else
- {
- *s1 = 255;
- p = s1 + 256 - (len = *s2++);
- }
- for (i=len; i; --i) *p++ = *s2++;
- }
-
- // ----------------------------------------------------------------------------------
- // TrapAvailable
- // ----------------------------------------------------------------------------------
- // Returns whether a specific trap is available.
-
- Boolean TrapAvailable ( short tNum, short tType)
- {
- return ( NGetTrapAddress(tNum,tType) != GetToolTrapAddress(_Unimplemented) );
- }
-
-